<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>

 <script>
 
     function checkblank()
     {
        n= document.forms[0].T1.value;
        a= document.forms[0].S1.value;
        
          if((n.length==0)||(a.length==0))
           {
             alert("Please fill up all the fields");
               
                if(n.length==0)
                 {
                    document.getElementById("nn").innerText="Fill the name field";
                 }
                 else if(a.length==0)
                 {
                    document.getElementById("add").innerText="Fill the address field";
                 }
                 

               return false; 
           }
  
     }
 
 </script>
</head>

<body>

<form method="get" action="servlet/MyDetails" onsubmit="return checkblank()">

	<div align="center">
		<table border="0" width="50%">
			<tr>
				<td>Name</td>
				<td><input type="text" name="T1" size="20"></td>
				<td><label id= "nn"></label></td>
			</tr>
			<tr>
				<td>Address</td>
				<td><textarea rows="2" name="S1" cols="20"></textarea></td>
				<td><label id= "add"></label></td>
			</tr>
			
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" value="Submit" name="B1"></td>
				<td>&nbsp;</td>
			</tr>
		</table>
	</div>
</form>

</body>

</html>